<template>
  <div id="make_knowledgeGraph" :class="{ 'no-data-mode': isNoData }">
    <div v-if="roles === 'teacher'" class="one-btns"></div>
    <HomeChart2_show @data-status="handleDataStatus" />
  </div>
</template>
    
<script>
import HomeChart2_show from "@/components/HomeChart2_show.vue";
export default {
  components: {
    HomeChart2_show,
  },
  name: "ZhishiIndex",
  data() {
    return {
      roles: "",
      isNoData: false,
    };
  },
  created() {
    this.roles = JSON.parse(localStorage.getItem("userInfo")).roles[0];
  },
  methods: {
    handleDataStatus(hasData) {
      this.isNoData = !hasData;
    },
  },
};
</script>
  <style lang="scss" scoped>
#make_knowledgeGraph {
  width: 100%;
  background-color: #fff;
  padding: 20px 30px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 650px;

  &.no-data-mode {
    padding: 0;
    background-color: #f3f5fa;
  }

  .one-btns {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
  }
  .all-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    height: 40px;
    line-height: 40px;
    background: #457aff;
    border-radius: 4px;
    font-size: 14px;
    color: #fff;
    padding: 0 18px;
    cursor: pointer;
  }
}
</style>